package cn.wuxing.mediation.system.service.impl;

import java.util.List;

import cn.wuxing.mediation.system.util.Desensitization;
import org.springframework.stereotype.Service;
import cn.wuxing.mediation.system.mapper.StgMplcHzZzEventDiWxqMapper;
import cn.wuxing.mediation.system.domain.StgMplcHzZzEventDiWxq;
import cn.wuxing.mediation.system.service.IStgMplcHzZzEventDiWxqService;

import javax.annotation.Resource;

/**
 * 事件信息总Service业务层处理
 *
 * @author mediation
 * @date 2024-11-27
 */
@Service
public class StgMplcHzZzEventDiWxqServiceImpl implements IStgMplcHzZzEventDiWxqService {
    @Resource
    private StgMplcHzZzEventDiWxqMapper stgMplcHzZzEventDiWxqMapper;

    /**
     * 查询事件信息总
     *
     * @param id 事件信息总主键
     * @return 事件信息总
     */
    @Override
    public StgMplcHzZzEventDiWxq selectStgMplcHzZzEventDiWxqById(String id) {
        StgMplcHzZzEventDiWxq stgMplcHzZzEventDiWxq = stgMplcHzZzEventDiWxqMapper.selectStgMplcHzZzEventDiWxqById(id);
        String address = stgMplcHzZzEventDiWxq.getAddress();//事件地址
        if (null != address) {
            stgMplcHzZzEventDiWxq.setAddress(Desensitization.desensitizedAddress(address));
        }

        String reportName = stgMplcHzZzEventDiWxq.getReportName();//上报人
        if (null != reportName) {
            stgMplcHzZzEventDiWxq.setReportName(Desensitization.desensitizedName(reportName));
        }

        String reportorTel = stgMplcHzZzEventDiWxq.getReportorTel();//上报人联系方式
        if (null != reportorTel) {
            stgMplcHzZzEventDiWxq.setReportorTel(Desensitization.mobilePhoneDesensitization(reportorTel));
        }

        String handleUser = stgMplcHzZzEventDiWxq.getHandleUser();//处理人
        if (null != handleUser) {
            stgMplcHzZzEventDiWxq.setHandleUser(Desensitization.desensitizedName(handleUser));
        }

        String endUser = stgMplcHzZzEventDiWxq.getEndUser();//结案人
        if (null != endUser) {
            stgMplcHzZzEventDiWxq.setEndUser(Desensitization.desensitizedName(endUser));
        }

        String involveName1 = stgMplcHzZzEventDiWxq.getInvolveName1();//涉事对象1
        if (null != involveName1) {
            stgMplcHzZzEventDiWxq.setInvolveName1(Desensitization.desensitizedName(involveName1));
        }

        String involveNum1 = stgMplcHzZzEventDiWxq.getInvolveNum1();//涉事对象1证件号码
        if (null != involveNum1) {
            stgMplcHzZzEventDiWxq.setInvolveNum1(Desensitization.idCardDesensitization(involveNum1));
        }

        String involveName2 = stgMplcHzZzEventDiWxq.getInvolveName2();//涉事对象2
        if(null!=involveName2){
            stgMplcHzZzEventDiWxq.setInvolveName2(Desensitization.desensitizedName(involveName2));
        }

        String involveNum2 = stgMplcHzZzEventDiWxq.getInvolveNum2();//涉事对象2证件号码
        if (null != involveNum2) {
            stgMplcHzZzEventDiWxq.setInvolveNum2(Desensitization.idCardDesensitization(involveNum2));
        }

        String involveName3 = stgMplcHzZzEventDiWxq.getInvolveName3();//涉事对象3
        if(null!=involveName3){
            stgMplcHzZzEventDiWxq.setInvolveName3(Desensitization.desensitizedName(involveName3));
        }

        String involveNum3 = stgMplcHzZzEventDiWxq.getInvolveNum3();//涉事对象3证件号码
        if(null!=involveNum3){
            stgMplcHzZzEventDiWxq.setInvolveNum3(Desensitization.idCardDesensitization(involveNum3));
        }

        String involveName4 = stgMplcHzZzEventDiWxq.getInvolveName4();//涉事对象4
        if(null!=involveName4){
            stgMplcHzZzEventDiWxq.setInvolveName4(Desensitization.desensitizedName(involveName4));
        }

        String involveNum4 = stgMplcHzZzEventDiWxq.getInvolveNum4();//涉事对象4证件号码
        if(null!=involveNum4){
            stgMplcHzZzEventDiWxq.setInvolveNum4(Desensitization.idCardDesensitization(involveNum4));
        }

        String involveName5 = stgMplcHzZzEventDiWxq.getInvolveName5();//涉事对象5
        if(null!=involveName5){
            stgMplcHzZzEventDiWxq.setInvolveName5(Desensitization.desensitizedName(involveName5));
        }

        String involveNum5 = stgMplcHzZzEventDiWxq.getInvolveNum5();//涉事对象5证件号码
        if(null!=involveNum5){
            stgMplcHzZzEventDiWxq.setInvolveNum5(Desensitization.idCardDesensitization(involveNum5));
        }

        String involveName6 = stgMplcHzZzEventDiWxq.getInvolveName6();//涉事对象6
        if(null!=involveName6){
            stgMplcHzZzEventDiWxq.setInvolveName6(Desensitization.desensitizedName(involveName6));
        }

        String involveNum6 = stgMplcHzZzEventDiWxq.getInvolveNum6();//涉事对象6证件号码
        if(null!=involveNum6){
            stgMplcHzZzEventDiWxq.setInvolveNum6(Desensitization.idCardDesensitization(involveNum6));
        }

        return stgMplcHzZzEventDiWxq;
    }

    /**
     * 查询事件信息总列表
     *
     * @param stgMplcHzZzEventDiWxq 事件信息总
     * @return 事件信息总
     */
    @Override
    public List<StgMplcHzZzEventDiWxq> selectStgMplcHzZzEventDiWxqList(StgMplcHzZzEventDiWxq stgMplcHzZzEventDiWxq) {
        return stgMplcHzZzEventDiWxqMapper.selectStgMplcHzZzEventDiWxqTempList(stgMplcHzZzEventDiWxq);
    }

    /**
     * 新增事件信息总
     *
     * @param stgMplcHzZzEventDiWxq 事件信息总
     * @return 结果
     */
    @Override
    public int insertStgMplcHzZzEventDiWxq(StgMplcHzZzEventDiWxq stgMplcHzZzEventDiWxq) {
        return stgMplcHzZzEventDiWxqMapper.insertStgMplcHzZzEventDiWxq(stgMplcHzZzEventDiWxq);
    }

    /**
     * 修改事件信息总
     *
     * @param stgMplcHzZzEventDiWxq 事件信息总
     * @return 结果
     */
    @Override
    public int updateStgMplcHzZzEventDiWxq(StgMplcHzZzEventDiWxq stgMplcHzZzEventDiWxq) {
        return stgMplcHzZzEventDiWxqMapper.updateStgMplcHzZzEventDiWxq(stgMplcHzZzEventDiWxq);
    }

    /**
     * 批量删除事件信息总
     *
     * @param ids 需要删除的事件信息总主键
     * @return 结果
     */
    @Override
    public int deleteStgMplcHzZzEventDiWxqByIds(String[] ids) {
        return stgMplcHzZzEventDiWxqMapper.deleteStgMplcHzZzEventDiWxqByIds(ids);
    }

    /**
     * 删除事件信息总信息
     *
     * @param id 事件信息总主键
     * @return 结果
     */
    @Override
    public int deleteStgMplcHzZzEventDiWxqById(String id) {
        return stgMplcHzZzEventDiWxqMapper.deleteStgMplcHzZzEventDiWxqById(id);
    }
}
